:root {
    --background-color: #2c3e50;
    --color1: #34495e;
    --color2: #7591AD;
    --color3: #EC3E27;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

body {
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 200px;
    height: 200px;
    border: 1px solid var(--color2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px;
}

.container label {
    position: relative;
    width: 30px;
    height: 30px;
    border: 2px solid var(--color2);
    border-radius: 50%;
    margin-right: 20px;
}

.container label::after {
    content: "";
    position: absolute;
    width: 60%;
    height: 60%;
    background-color: var(--color2);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: .2s ease-in;
}

.container [type=radio] {
    display: none;
}

.container [type=radio]:checked+label::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 第二个效果 */

/* 第二个效果在第一个效果的基础上增加了一个旋转进入动画 */
.container2 {
    width: 200px;
    height: 200px;
    border: 1px solid var(--color2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px;
}

.container2 label {
    position: relative;
    width: 30px;
    height: 30px;
    border: 2px solid var(--color2);
    border-radius: 50%;
    margin-right: 20px;
    overflow: hidden;
}

.container2 label::after {
    content: "";
    position: absolute;
    width: 60%;
    height: 60%;
    background-color: var(--color2);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    transform-origin: -2px 50%;
    opacity: 0;
    transition: .2s ease-in;
}

.container2 [type=radio] {
    display: none;
}

.container2 [type=radio]:checked+label::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

